<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
      <button @click="createData">动态创建一个属性</button>
      <div v-if="isShow">
        <button @click="changeData">修改这个数据</button>
        {{ msg }}
      </div>
  </div>
  <script src="./vue.global.js"></script>
  <script>
    const { createApp } = Vue;
    const app = createApp({
      data(){
        return {
          isShow: false
        }
      },
      methods: {
        changeData(){
          this.msg = '值修改了';
          console.log(this.msg);
        },
        createData() {
          this.msg = '这是动态创建的一个值';
          this.isShow = true;
        }
      },
    })
    app.mount('#app')
  </script>
</body>
</html>